'use strict';

/* global think */
module.exports = class extends think.Logic {

    /**
     * 删除分类
     */
    async delAction() {
        const rules = {
            id: { int: true, required: true },
            confirm: { int: true, required: false, default: 0 },
            type: { string: true, required: false, default: '' },
        };

        const flag = this.validate(rules);

        if (!flag) {
            return this.fail('validate error', this.validateErrors);
            // 如果校验失败，返回
            // {"errno":1000,"errmsg":"validate error","data":{"username":"username can not be blank"}}
        }
    }

};
